<%@ page language="java" import="java.util.*,java.sql.*,connBean.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<jsp:useBean id="db" class="connBean.ConnDB" scope="page">
</jsp:useBean>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <% 
    request.setCharacterEncoding("utf-8");
    int order_id=Integer.parseInt(request.getParameter("order_id"));
    int pay_id=Integer.parseInt(request.getParameter("pay_id"));  
    String order_address=request.getParameter("order_address");
    String order_email=request.getParameter("order_email");
    String order_time=request.getParameter("order_time");
    int order_status=Integer.parseInt(request.getParameter("order_status"));  

     
    String sql="update orders set  pay_id="+ pay_id+" ,order_address='"+order_address+"',order_email='"+order_email+"', order_time='"+order_time+"', order_status="+order_status+" where order_id="+order_id+"";//定义插入SQL语句
    System.out.println(sql);
db.OpenConn();
db.createStmt();


int result=db.Update(sql);



 if(result==1){ 
 response.sendRedirect("selectorders.jsp");//执行插入成功跳转
 }else{
 %>
修改订单失败，等待5秒后返回。
 <%
 response.setHeader("Refresh","5;URL=selectorders.jsp");//执行插入失败跳转
 }
 db.closeStmt();
 db.closeConn();
    %>

  </body>
</html>